package ar.edu.itba.it.cg.grupo01.game.action;

import ar.edu.itba.it.cg.grupo01.game.sound.Pioneer;
import ar.edu.itba.it.cg.grupo01.game.sound.PioneerSoundSystem;
import ar.edu.itba.it.cg.grupo01.game.terrain.Circuit;
import ar.edu.itba.it.cg.grupo01.vehicle.Car;

import com.jme.input.action.InputAction;
import com.jme.input.action.InputActionEvent;
import com.jme.math.Vector3f;

public class ResetAction extends InputAction{
	Pioneer audio;
	Car theCar;
	Circuit theCircuit;

	public ResetAction(Pioneer audioSystem, Car theCar, Circuit aCircuit) {
		this.audio = audioSystem;
		this.theCar = theCar;
		this.theCircuit = aCircuit;
	}

	public void performAction(InputActionEvent evt) {
		Vector3f carPos = theCircuit.getLastCheckPointVisited();
		audio.playEffect(PioneerSoundSystem.CARRESET, false);
		theCar.setPosition(carPos.x, carPos.y, carPos.z);

	}

	public void setTheCircuit(Circuit theCircuit) {
		this.theCircuit = theCircuit;
	}

	public void setTheCar(Car theCar) {
		this.theCar = theCar;
	}

	
}

